package chapter04.demo1;
class Animal02 {
    private String name;
    private  int age;
    public  String getName(){
        return  name;
    }
    public void setName (String name){
        this.name = name;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int age){
        this.age = age;
    }
}
class Pig extends Animal02{
    private  String color;
    public String getColor(){
        return color;
    }
    public void setColor(String color){
        this.color = color;
    }
}
public class Example02 {
    public static void main(String[] args) {
        Pig pig = new Pig();
        pig.setName("牧羊犬");
        pig.setAge(3);
        pig.setColor("黑色");
        System.out.println("名称："+pig.getName() +",年龄："+pig.getAge()+",颜色："+pig.getColor());
    }
}
